package cn.zzxy.day01;
import java.sql.*;
/**
 * 通过Java代码执行删除表jdbctable
 */
public class Demo2 {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection conn = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/exam?serverTimezone=UTC",
                "root","root"
        );
        Statement st = conn.createStatement();
        String sql = "drop table jdbctable";
        st.execute(sql);
        System.out.println("执行完成");
        conn.close();
    }
}
